package com.lphl.pet.adapter;

import com.lphl.pet.R;
import com.lphl.pet.R.id;
import com.lphl.pet.R.layout;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class ChoosePetActivityAdapter extends BaseAdapter {

	private LayoutInflater inflater;
	private ViewHolder holder;
	
	public ChoosePetActivityAdapter(Context ct) {
		inflater = LayoutInflater.from(ct);
	}

	@Override
	public int getCount() {
		return 2;
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView == null){
			holder = new ViewHolder();
			convertView = inflater.inflate(R.layout.lv_choose_pet_item, null);
			holder.iv_pet_icon = (ImageView) convertView.findViewById(R.id.iv_pet_icon);
			holder.choose_pet_title_lv_pet_name = (TextView) convertView.findViewById(R.id.choose_pet_title_lv_pet_name);
			holder.choose_pet_title_lv_pet_type = (TextView) convertView.findViewById(R.id.choose_pet_title_lv_pet_type);
			holder.choose_pet_title_lv_bind = (TextView) convertView.findViewById(R.id.choose_pet_title_lv_bind);
			holder.iv_bind = (ImageView) convertView.findViewById(R.id.iv_bind);
			convertView.setTag(holder);
		}else{
			holder = (ViewHolder) convertView.getTag();
		}
		
		holder.iv_bind.setOnClickListener(null);
		
		//TODO 添加数据
		
		
		
		return convertView;
	}
	
	static class ViewHolder{
		ImageView iv_pet_icon;
		TextView choose_pet_title_lv_pet_name;
		TextView choose_pet_title_lv_pet_type;
		TextView choose_pet_title_lv_bind;
		ImageView iv_bind;
	}

}
